# @Author：silence
# @Email：792245022@qq.com
# @Date：2025/3/3 23:35

import urllib.request
import urllib.error

url = "https://blog.csdn.net/sulixu/article/details/119818949"

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0",
}

try:
    request = urllib.request.Request(url=url, headers=headers)

    response = urllib.request.urlopen(request)

    content = response.read().decode("utf-8")

    print(content)
except urllib.error.HTTPError as e:
    print(e)
    print("爬取失败！")
except urllib.error.URLError as e:
    print(e)
    print("爬取失败！")

